package oopday02;
//验证重写后的测试Demo
public class OverrideTestDemo {
    public static void main(String[] args) {
        //创建Student对象
        Student zg = new Student("张光",23, "廊坊", "JSD2035", "002");
        zg.sayHi();     //调用Student类重写后的sayHi（）方法，new谁用就调用谁的

        //创建Teacher对象
        Teacher ll =new Teacher("李林",35,"佳木斯", 6000.0);
        ll.sayHi();     //调用Teacher类重写后的sayHi（）方法，new谁用就调用谁的

        //创建Doctor对象
        Doctor zl =new Doctor("赵亮",45,"济南", "主治医生");
        zl.sayHi();     //调用Doctor类重写后的sayHi()方法，所以调用的是继承Person类的sayHi()方法

    }
}
